4 Lecture

CS302

Midterm & Final Term Short Notes

NUMBER SYSTEMS & CODES

Number systems are ways to represent numerical values using symbols. The most common number systems are decimal, binary, octal, and hexadecimal. Codes are systems that encode information using symbols, such as the ASCII code for representing cha


Important Mcq's
Midterm & Finalterm Prepration
Past papers included

Download PDF
  1. Which number system is commonly used in digital electronics? a) Decimal b) Binary c) Octal d) Hexadecimal Answer: b) Binary

  2. What is the base of the hexadecimal number system? a) 2 b) 8 c) 10 d) 16 Answer: d) 16

  3. What is the decimal equivalent of the binary number 101101? a) 41 b) 45 c) 53 d) 59 Answer: d) 59

  4. Which of the following is a BCD code for the decimal number 3? a) 0010 b) 0100 c) 0011 d) 0101 Answer: b) 0100

  5. What is the excess-3 code for the decimal number 5? a) 1000 b) 1010 c) 1100 d) 1110 Answer: d) 1110

  6. Which of the following is the most compact representation of the number 255 in binary? a) 11111111 b) 11111110 c) 11111101 d) 11111100 Answer: a) 11111111

  7. Which code is used to represent alphanumeric characters in a computer? a) ASCII b) BCD c) Gray d) Excess-3 Answer: a) ASCII

  8. What is the octal equivalent of the binary number 101010? a) 22 b) 42 c) 52 d) 62 Answer: b) 42

  9. Which of the following is a Gray code for the binary number 1001? a) 1100 b) 1110 c) 1111 d) 1011 Answer: d) 1011

  10. What is the decimal equivalent of the octal number 77? a) 56 b) 63 c) 70 d) 73 Answer: b) 63



Subjective Short Notes
Midterm & Finalterm Prepration
Past papers included

Download PDF
  1. What is a number system? Answer: A number system is a way to represent numerical values using symbols. Examples of number systems include decimal, binary, octal, and hexadecimal.

  2. What is binary code? Answer: Binary code is a system of representing data using only two symbols, typically 0 and 1. Binary code is commonly used in digital electronics and computing.

  3. What is the difference between a digital signal and an analog signal? Answer: A digital signal is a discrete signal that only has specific, discrete values, such as 0 or 1. An analog signal is a continuous signal that can have any value within a certain range.

  4. What is the purpose of a code in digital electronics? Answer: Codes are used to represent information using symbols, such as binary codes for representing data in a computer. Codes can also be used for error detection and correction.

  5. What is an excess-3 code? Answer: An excess-3 code is a binary code that adds 3 to the decimal value of a number before encoding it in binary. This code is used for BCD arithmetic.

  6. What is the difference between BCD and binary codes? Answer: BCD codes are a type of binary code that represents each decimal digit using a 4-bit binary code. Binary codes, on the other hand, can represent any numerical value using a combination of 0 and 1.

  7. What is a Gray code? Answer: A Gray code is a binary code in which only one bit changes between consecutive numbers. Gray codes are used in digital circuits for reducing the likelihood of errors during transitions between values.

  8. What is the purpose of a parity bit in a code? Answer: A parity bit is used for error detection in codes. The parity bit is set to either 0 or 1 depending on whether the number of 1 bits in the code is even or odd.

  9. What is the purpose of a radix point in a number system? Answer: A radix point is used to separate the integer part and the fractional part of a number in a number system. The radix point is typically represented by a decimal point in the decimal system, a binary point in the binary system, and so on.

  10. What is the significance of the base of a number system? Answer: The base of a number system determines the number of symbols used to represent a value. For example, the binary system has a base of 2 and uses only two symbols, 0 and 1, to represent numerical values.

Number systems and codes are fundamental concepts in computer science and digital electronics. A number system is a way to represent numerical values using symbols, while codes are systems that encode information using symbols. The most common number systems used in digital electronics are binary, octal, decimal, and hexadecimal. The binary system uses only two symbols, 0 and 1, and is commonly used in digital circuits and computing. The octal system uses eight symbols, 0 through 7, while the decimal system uses ten symbols, 0 through 9. The hexadecimal system uses sixteen symbols, 0 through 9 and A through F. Codes are used to represent information using symbols. One common code is the American Standard Code for Information Interchange (ASCII), which is used to represent alphanumeric characters in a computer. Other codes include Binary Coded Decimal (BCD), Excess-3, and Gray codes. BCD is a type of binary code that represents each decimal digit using a 4-bit binary code, while Excess-3 is a binary code that adds 3 to the decimal value of a number before encoding it in binary. Gray codes are used in digital circuits for reducing the likelihood of errors during transitions between values. In digital electronics, it is essential to be able to convert between different number systems and codes. For example, to convert a decimal number to binary, you can use the method of repeated division by 2. To convert a binary number to hexadecimal, you can group the binary digits into groups of four and convert each group to its hexadecimal equivalent. Another important concept in digital electronics is the use of parity bits for error detection. A parity bit is a bit that is added to a code to ensure that the number of 1 bits in the code is either even or odd. If the parity bit is set incorrectly, it indicates that an error has occurred in the transmission or storage of the data. In summary, number systems and codes are essential concepts in digital electronics and computer science. They allow us to represent numerical values and information using symbols and are critical for designing and programming digital systems.